package com.test.gk;

import net.sourceforge.tess4j.Tesseract;
import net.sourceforge.tess4j.TesseractException;

import java.io.File;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");

        String imagePath = "C:\\Users\\503389810\\Downloads\\Snipaste_2024-04-30_16-53-18.png";
        File file = new File(imagePath);
        Tesseract tesseract = new Tesseract();
        tesseract.setDatapath("C:\\Users\\503389810\\Documents\\StudySpace\\logframe\\JCL\\src\\main\\resources\\tessdata");
        tesseract.setLanguage("eng");
        String result = "";
        try {
            result = tesseract.doOCR(file);
        } catch (TesseractException e) {
            throw new RuntimeException(e);
        }
        System.out.println(result);
    }
}